package com.prs.crm;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

/**
 * @author LanXiaoGang
 * @E-mail:lan9liang@163.com
 * @qq:7857553326
 * @version 创建时间：2011-3-9 上午11:26:42
 * 简单说明
 */

public class Sms {
	private int sendSMS4Other(String Mobile,String Content,String send_time) throws MalformedURLException, UnsupportedEncodingException {
		URL url = null;
//		String CorpID=SmsUtil.appSmsClient().getConfig().getSmsPlatUser();//账户名
//		String Pwd=SmsUtil.appSmsClient().getConfig().getSmsPlatPwd();//密码
		String CorpID="LKSDK0003020";
		String Pwd="762579";
		String send_content=URLEncoder.encode(Content.replaceAll("<br/>", " "), "GBK");//发送内容
		url = new URL("  http://mb345.com/WS/Send.aspx?CorpID="+CorpID+"&Pwd="+Pwd+"&Mobile="+Mobile+"&Content="+send_content+"&Cell=&SendTime="+send_time);
		BufferedReader in = null;
		int inputLine = 0;
		try {
		System.out.println("开始发送短信手机号码为 ："+Mobile);
		in = new BufferedReader(new InputStreamReader(url.openStream()));
		inputLine = new Integer(in.readLine()).intValue();
		} catch (Exception e) {
		System.out.println("网络异常,发送短信失败！");
		inputLine=-9;
		}
		System.out.println("结束发送短信返回值：  "+inputLine);
		return inputLine;
		}
	public static void main(String[] args) throws MalformedURLException, UnsupportedEncodingException {
		Sms  s=new Sms();
		s.sendSMS4Other("13076018077", "throws MalformedURLException, UnsupportedEncodingExceptions","2011");

	}

}
